Advanced Debugging
About AdvDbg Consult Train Services Products Tools Community Contact  
欢迎光临 高端调试 登录 | 注册 | FAQ
 
  ACPI调试
Linux内核调试
Windows内核调试
 
  调试战役
调试原理
新工具观察
 
  Linux
Windows Vista
Windows
 
  Linux驱动
WDF
WDM
 
  PCI Express
PCI/PCI-X
USB
无线通信协议
 
  64位CPU
ARM
IA-32
  CPU Info Center
 
  ACPI标准
系统认证
Desktop
服务器
 
  Embedded Linux
嵌入式开发工具
VxWorks
WinCE
嵌入式Windows
 
  格蠹调试套件(GDK)
  格蠹学院
  小朱书店
  老雷的微博
  《软件调试》
  《格蠹汇编》
  《软件调试(第二版)》
沪ICP备11027180号-1

资源

帖子发起人: 土豆泥   发起时间: 2006-08-20 15:37 下午   回复: 0

Print Search
帖子排序:    
   2006-08-20, 15:37 下午
tudouni 离线,最后访问时间: 2012/11/8 12:04:22 土豆泥

发帖数前25位
注册: 2006-04-07
发 贴: 59
Schema是什么?
Reply Quote
Schema,是不是个很晕的词?可它又难以逃避,数据库里有Schema,XML里有Schema,WMI/WBEM/CIM里也有Schema,一句话,有建模的地方就有Schema。从下面的文章来看,老外自己对这个词也满晕的,哈哈.......

What Is a Schema

by Norman Walsh
July 01, 1999

A schema is a model for describing the structure of information. It's a term borrowed from the database world to describe the structure of data in relational tables. In the context of XML, a schema describes a model for a whole class of documents. The model describes the possible arrangement of tags and text in a valid document. A schema might also be viewed as an agreement on a common vocabulary for a particular application that involves exchanging documents.

Schemas may sound a little technical, but we use them to analyze the world around us. For example, suppose I ask you, "is this a valid postal address?"

<address>
<name>Namron H. Slaw</name>
<street>256 Eight Bit Lane</street>
<city>East Yahoo</city>
<state>MA</state>
<zip>12481-6326</zip>
</address>

Mentally, you compare the address presented with a schema that you have in your head for addresses. It probably goes something like this: a postal address consists of a person, possibly at a company or organization, one or more lines of street address, a city, a state or province, a postal code, and an optional country. So, yes, this address is valid.

In schemas, models are described in terms of constraints. A constraint defines what can appear in any given context. There are basically two kinds of constraints that you can give: content model constraints describe the order and sequence of elements and datatype constraints describe valid units of data.

For example, a schema might describe a valid <address> with the content model constraint that it consist of a <name> element, followed by one or more <street> elements, followed by exactly one <city>, <state>, and <zip> element. The content of a <zip> might have a further datatype constraint that it consist of either a sequence of exactly five digits or a sequence of five digits, followed by a hyphen, followed by a sequence of exactly four digits. No other text is a valid ZIP code.

The purpose of a schema is to allow machine validation of document structure. Every specific, individual document which doesn't violate any of the constraints of the model is, by definition, valid according to that schema.

Using the schema described (informally) above, a parser would be able to detect that the following address is not valid:

<address>
<name>Namron H. Slaw</name>
<street>256 Eight Bit Lane</street>
<city>East Yahoo</city>
<state>MA</state>
<state>CT</state>
<zip>blue</zip>
</address>

It violates two constraints of our schema: it does not contain exactly one <state> and the ZIP code is not of the proper form. A formal definition of this schema for addresses is presented in the syntax section.

The ability to test the validity of documents is going to be an important aspect of large web applications that are receiving and sending information to and from lots of sources. If you're receiving XML transactions over the web, you don't want to process the content into your database if it's not in the proper schema. The earlier, and easier it is, to catch this sort of error, the better off you'll be. (You wouldn't want to issue someone a refund check because you allowed them to order -4 hammers, would you?)


IP 地址: 已记录   报告
高端调试 » Windows Vista » 资源 » Schema是什么?

 
Legal Notice Privacy Statement Corporate Governance Corporate Governance
(C)2004-2020 ADVDBG.ORG All Rights Reserved.